<template>
  <div class="mine-container">
    <div class="top-container">
      <div class="user-top">
        <div class="left">
          <img :src="userInfo.photo" alt="" />
          <span>你好</span>
        </div>
        <div class="right">
          <span>编辑资料</span>
        </div>
      </div>
      <div class="count">
        <div class="item">
          <p>{{ userInfo.art_count }}</p>
          <p>头条</p>
        </div>
        <div class="item">
          <p>{{ userInfo.follow_count }}</p>
          <p>关注</p>
        </div>
        <div class="item">
          <p>{{ userInfo.fans_count }}</p>
          <p>粉丝</p>
        </div>
        <div class="item">
          <p>{{ userInfo.like_count }}</p>
          <p>获赞</p>
        </div>
      </div>
    </div>
    <div class="center-container"></div>
    <div class="list-container">
      <van-cell title="消息通知" is-link />
      <van-cell title="聊天" is-link />
      <van-cell title="退出" is-link />
    </div>
  </div>
</template>

<script>
import { getUserInfoApi } from "@/api/userApi.js";
export default {
  name: "myPage",
  components: {},
  props: {},
  data() {
    return {
      userInfo: {},
    };
  },
  computed: {},
  watch: {},
  created() {
    this.getUserInfo();
  },
  mounted() {},
  methods: {
    async getUserInfo() {
      const { data: res } = await getUserInfoApi();
      this.userInfo = res.data;
    },
  },
};
</script>

<style scoped lang="less">
.mine-container {
  font-size: 28px;
  .top-container {
    height: 300px;
    background: #4ca3f8;
    padding: 26px 30px 0;
    box-sizing: border-box;
    .user-top {
      display: flex;
      justify-content: space-between;
    }
    .left {
      img {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        vertical-align: middle;
      }
      span {
        margin-left: 20px;
        color: white;
      }
    }
    .right {
      margin-top: 26px;
      span {
        border-radius: 20px;
        background-color: #fff;
        padding: 5px;
      }
    }
    .count {
      margin-top: 40px;
      display: flex;
      justify-content: space-around;
      .item {
        height: 60px;
        color: #fff;
      }
    }
  }
}
</style>
